import asyncio
import os
import sys
from src.task3.task3_main import TaskOrchestrator3


def main():
    # """主函数"""
    if len(sys.argv) != 2:
        print("使用方法: python run_task.py 'topic'")
        print(f"  示例: python run_task.py '2025 Q3 AI大模型安全政策法规'")
        return
    topic = sys.argv[1]
    #topic = '2025 Q3 AI大模型安全技术突破轻量化部署创新案例政策法规'
    # 创建任务编排器并执行任务
    orchestrator = TaskOrchestrator3()
    try:
        asyncio.run(orchestrator.execute_task(topic))
    except KeyboardInterrupt:
        orchestrator.deal_exception()
        print(f"---任务已中断，可重新运行程序继续任务----")
        pass

if __name__ == "__main__":
    main()